
var tableren;

function resta(){
    tableren.reload();
}

layui.use(['table','laydate','form','layer'],function (){
    var table = layui.table;
    var laydate = layui.laydate;
    var form = layui.form;
    var layer = layui.layer;

    laydate.render({
        elem: '#js'
    });

    $(function (){
        tablein();
    })

    function tablein(){

        tableren =  table.render({

            // height:500,
            elem:'#home',
            id:'tableIn',
            url:'/land/getAll',

            page:{
                layout:['count','prev','page','next','limit'],
                limit:10,
                limits:[20,30,40],
                group:5
            },
            cols:[
                [
                    {field: 'id', title: '登陆序号', width:80}
                    ,{field: 'username', title: '登陆者输入用户', width:150}
                    ,{field: 'password', title: '登陆者输入密码', width: 150}
                    ,{field: 'ip', title: '登陆者IP地址', width: 150}
                    ,{field: 'date', title: '登陆时间', width: 200 }
                    ,{field: 'zhuangtai', title: '状态', width: 150 }

                ]
            ],
            parseData:function (res){
                console.log(res)
                return{
                    "code":res.state,
                    "msg":res.msg,
                    "count":res.total,
                    "data":res.data
                }
            },
            done:function (res,curr,count){
                console.log(count);
            },
        });
    }
})
